package com.shixianjun.leetcode;

public class _2011_执行操作后的变量值 {
    static public int finalValueAfterOperations(String[] operations) {

        int result = 0;
        for (String item : operations) {
            if ('+' == item.charAt(1)) {
                result++;
            } else {
                result--;
            }
        }
        return result;
    }
    
    public static void main(String[] args) {
        int result = finalValueAfterOperations(new String[]{"--X", "X++", "X++"});
        System.out.print(result);
    }
}
